\begin{algorithm}[!hpbt]
\caption{ Statistics based dead-block prediction}\label{alg}
\begin{algorithmic}[1]
\Require
A cache block set $\{C_i\}, i=1,2,...N$.
Dead block proportions for each RUB $\{R_j\},j=1,2,...M$.
Death threshold $D_{th}$

\Ensure
States $S_i$ (live=0, dead=1) for each cache line $C_i, i=1,2,...N$;
\State Initial $S[i] \gets 0$ for all cache lines, death sentence $D[j] \gets 0, j=1,2,...M$

\For{j=1 to M}
\If {$R[j] > D_{th}$}
\State $D[j] \gets 1$
\EndIf
\EndFor

\ForAll{Cache lines $[i]$}
\If {$C[i] \to dirty =0$ and $D[C_i \to RUB]=1$ or $C[i] \to valid = 0$} 
\State $S[i] \gets 1$
\EndIf
\EndFor

%\For {j=1 to M}
%\If {$R_j>D_{th}$}
% \ForAll{Cache lines $C_i$}
%\If {$C_i \to RUB == j$}
%\State $C_i \to S = 1$
%\EndIf
%%\EndIf
%\EndFor
%\EndIf
%\EndFor


\end{algorithmic}
\end{algorithm}

